import Vue from 'vue'
import VueRouter from 'vue-router'
import Main from '../views/Main.vue'
import User from '../views/User/index.vue'
import Home from '../views/home/index.vue'
import Mall from '../views/mall/index.vue'
import PageOne from '../views/other/pageOne.vue'
import PageTwo from '../views/other/pageTwo.vue'
import Login from '../views/login/login.vue'
Vue.use(VueRouter)

export default new VueRouter({
    name:'router',
    mode:'history',
    routes:[
        {
          path:'/',
          name:'Main',
          redirect: '/home',
          component:Main,
          children:[
            {
                path:'/home',
                name:'home',
                component:Home
            },
            {
                path:'/user',
                name:'user',
                component:User
            },
            {
              path:'/mall',
              name:'mall',
              component:Mall
            },
            {
              path:'/page1',
              name:'page1',
              component:PageOne
            },
            {
              path:'/page2',
              name:'page2',
              component:PageTwo
            },
          ]

        },
        {
          path:'/login',
          name:'login',
          component:Login
        }
    ]
})
